package com.jc.cloud.sign.controller.tencent;

import java.util.Arrays;
import java.util.Map;


import com.jc.cloud.sign.common.PageUtils;
import com.jc.cloud.sign.common.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jc.cloud.sign.bean.entity.TbContractcancelEntity;
import com.jc.cloud.sign.service.TbContractcancelService;




/**
 * 合同撤销扣费返还通知
 *
 * @author whx
 * @email sunlightcs@gmail.com
 * @date 2023-11-13 22:08:30
 */
@RestController
@RequestMapping("sign/tbcontractcancel")
public class TbContractcancelController {
    @Autowired
    private TbContractcancelService tbContractcancelService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("sign:tbcontractcancel:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = tbContractcancelService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("sign:tbcontractcancel:info")
    public R info(@PathVariable("id") Integer id){
		TbContractcancelEntity tbContractcancel = tbContractcancelService.getById(id);

        return R.ok().put("tbContractcancel", tbContractcancel);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("sign:tbcontractcancel:save")
    public R save(@RequestBody TbContractcancelEntity tbContractcancel){
		tbContractcancelService.save(tbContractcancel);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("sign:tbcontractcancel:update")
    public R update(@RequestBody TbContractcancelEntity tbContractcancel){
		tbContractcancelService.updateById(tbContractcancel);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("sign:tbcontractcancel:delete")
    public R delete(@RequestBody Integer[] ids){
		tbContractcancelService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
